import { get, post } from "@/utils/request";

/**
 * 添加工具
 * @param params
 */
export const toolAdd = async (params: any) => {
  return await post("/tool/add", params);
};

/**
 * 更新工具
 * @param params
 */
export const toolUpdate = async (params: any) => {
  return await post("/tool/update", params);
};

/**
 * 编辑工具
 * @param params
 */
export const toolEdit = async (params: any) => {
  return await post("/tool/edit", params);
};

/**
 * 删除工具
 * @param params
 */
export const toolDelete = async (params: any) => {
  return await post("/tool/delete", params);
};

/**
 * 上线工具
 * @param params
 */
export const onlineTool = async (params: any) => {
  return await post("/tool/online", params);
};

/**
 * 下线工具
 * @param params
 */
export const offlineTool = async (params: any) => {
  return await post("/tool/offline", params);
};

/**
 * 调用工具
 * @param params
 */
export const invokeTool = async (params: any) => {
  return await post("/tool/invoke", params);
};

/**
 * 通过id获取工具封装类
 * @param id
 */
export const getToolVOById = async (id: string) => {
  return await get("/tool/get/vo?id=" + id);
};

/**
 * 分页查询工具
 * @param params
 */
export const toolByPage = async (params: any) => {
  return await post("/tool/list/page", params);
};

/**
 * 分页查询工具封装类
 * @param params
 */
export const toolVOByPage = async (params: any) => {
  return await post("/tool/list/page/vo", params);
};
